

VHmeasure <-function(frame, hc) {
  if (missing(frame) || missing(hc)) stop("syntax error")
  if (class(frame) != "AEP.frame") stop("the parameter 'frame' must be of type 'AEP.frame'")
  if (class(hc) != "AEP.HCSimplex") stop("the parameter 'hc' must be of type 'AEP.HCSimplex'")
  if (length(hc@b) != frame@nb_var) stop("hc@b is too long")  	
  
  samplePoints <- array(0, c(frame@N, frame@nb_var))
  Uval <- array(0, c(frame@N, frame@nb_var))
  for (i in 1:frame@N) {
    samplePoints[i,] <- hc@b + (hc@h * frame@binary_matrix[i,])
    for (j in 1:frame@nb_var) Uval[i,j] <- frame@ECDF(j, samplePoints[i,j])	
  }
  H <- C.n(u=Uval, U=frame@pobs_data)
  Hm <- frame@Hmultiplier * H	
  abs(sum(Hm))
}